home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Hello / Sources / Content.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.6 KB  |  94 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Content.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef CONTENT_H
  11. #define CONTENT_H
  12.  
  13. #ifndef DEFINES_K
  14. #include "Defines.k"
  15. #endif
  16.  
  17. // ----- Framework Includes -----
  18.  
  19. #ifndef FWCONTNT_H
  20. #include "FWContnt.h"
  21. #endif
  22.  
  23. #ifndef FWSTRING_H
  24. #include "FWString.h"
  25. #endif
  26.  
  27. //========================================================================================
  28. //    Forward Declarations
  29. //========================================================================================
  30.  
  31. class CHelloPart;
  32. class FW_CReadableStream;
  33.  
  34. //========================================================================================
  35. //    class CHelloContent
  36. //========================================================================================
  37.  
  38. class CHelloContent : public FW_CContent
  39. {
  40. //----------------------------------------------------------------------------------------
  41. //    Initialization/Destruction
  42. //
  43. public:
  44.     FW_DECLARE_AUTO(CHelloContent)
  45.     
  46.     CHelloContent(Environment* ev, CHelloPart* part);
  47.     virtual ~CHelloContent();
  48.  
  49. //----------------------------------------------------------------------------------------
  50. //    Inherited API
  51. //
  52. public:
  53.     virtual void        ExternalizeKind(Environment* ev,
  54.                                      ODStorageUnit* storageUnit,
  55.                                       FW_CKind* kind,
  56.                                      FW_StorageKinds storageKind,
  57.                                      FW_CPromise* promise,
  58.                                      FW_CCloneInfo* cloneInfo);
  59.     virtual FW_Boolean    InternalizeKind(Environment* ev,
  60.                                      ODStorageUnit* storageUnit, 
  61.                                       FW_CKind* kind,
  62.                                      FW_StorageKinds storageKind,
  63.                                      FW_CCloneInfo* cloneInfo);
  64.  
  65. //----------------------------------------------------------------------------------------
  66. //    New API
  67. //
  68. public:
  69.     const FW_CString&    GetTextData();
  70.     void                SetTextData(Environment* ev, const FW_CString& newText);
  71.     void                ClearTextData(Environment* ev);
  72.  
  73.     FW_Boolean            IsTextCentered();
  74.     void                CenterText(Environment* ev, FW_Boolean state);
  75.  
  76. //----------------------------------------------------------------------------------------
  77. //    Data Members
  78. //
  79. protected:
  80.     FW_CString            fTextData;            // part content
  81.     FW_Boolean            fCentered;            // part setting
  82.     CHelloPart*            fHelloPart;
  83. };
  84.  
  85. //========================================================================================
  86. // Inlines
  87. //========================================================================================
  88.  
  89. inline FW_Boolean CHelloContent::IsTextCentered()
  90. {
  91.     return fCentered;
  92. }
  93.  
  94. #endif